<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=0.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<link href="/assets/src/css/public.css" type="text/css" rel="stylesheet"/>
<link href="/assets/src/css/bluecolor.css" type="text/css" rel="stylesheet"/>
<!-- Link Swiper's CSS -->
<link rel="stylesheet" href="/assets/src/css/swiper.min.css"/>

<link rel="stylesheet" href="/assets/css/alipay.css">
<script src="/assets/js/jquery-1.8.1.min.js"></script>
<script src="/assets/js/jQuery-getUrlParam.js"></script>
<script type="text/javascript">

$(document).ready(function(){
	var url = "/order/check";
	var reqlatid = $("#latid").val();
	$(".footer-btn-sm-7").click(function(){
		$.post(
				url,
				{latid:reqlatid},
				function(data){
					if(data == 0){
						alert("商品已售空");
					}else{
						var orderUrl = "/order/buy";
						$.post(
								orderUrl,
								{latid:reqlatid},
								function(data){
										if(data == 0){
											//用户未登录
											window.location.href="/login";
										}else{
											if(data == 2){
												alert("商品已售空");
											}else{
												//alert(data);
													//购买成功
													window.location.href="/order/buy/success?oid="+data;
											}
										
										
									}
								}
								);
					}
				}
				);
	});
});

</script>
<title>CIT商品列表</title>
</head>
<body>
<header class="product-hd hd-color"> <a href="javascript:;" onclick="history.go(-1)" class="pre index-pre"></a>商品详情|订单 </header>

<div class="content">
    <div class="content-title">${commoditiesDetail.coName }</div>
    <div class="content-commodities-img">
        <img src="/read/upload?name=${commoditiesDetail.coPhoto }">
        <div class="content-commodities-img-rea"></div>
        <div class="content-commodities-img-reb"></div>
    </div>

    <div class="content-commodities_price">
        <div class="content-commodities-price-left">
            <div class="content-commodities-price-one">价格：${commoditiesDetail.coPrice }</div>
            <div class="content-commodities-price-second">优惠：<i>您暂无优惠卷</i></div>
        </div>
        <div class="content-commodities-price-right">
            <div class="content-commodities-price-third"><i>￥${commoditiesDetail.coPrice }</i><p>实付金额</p></div>
        </div>
    </div>
</div>
<div class="footer">
	<input id="latid" type="hidden" value="${latid }">
    <div class="footer-btn-sm-7">支付宝支付</div>
    <div class="footer-btn-sm-3"><img src="/assets/images/ico-png/qiehuan.png"></div>
</div>



<!-- Swiper JS --> 
<script src="/assets/src/js/swiper.min.js"></script> 

<!-- Initialize Swiper --> 
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        paginationClickable: true,
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: 2500,
        autoplayDisableOnInteraction: false
    });
    </script>
</body>
</body>
</html>